package allertest;

import java.util.logging.Handler;
import java.util.logging.LogRecord;
import javax.swing.JTextArea;

public class TextAreaLogHandler extends Handler {

    public TextAreaLogHandler(JTextArea ta) {
        super();
        textArea = ta;
    }

    public void publish(LogRecord record) {
            
        if (!isLoggable(record)) {
            return;
        }
    
        textArea.append(record.getMessage() + "\n");
    }

    public void flush() {
    
    }

    public void close() throws SecurityException {
            
    }
    
    private JTextArea textArea;

}